<!DOCTYPE html>
<html class=" js no-touch csstransforms3d csstransitions">
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <meta charset="utf-8">
    <title>商品发布</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
    <link rel="apple-touch-icon" href="pages/ico/60.png">
    <link rel="apple-touch-icon" sizes="76x76" href="pages/ico/76.png">
    <link rel="apple-touch-icon" sizes="120x120" href="pages/ico/120.png">
    <link rel="apple-touch-icon" sizes="152x152" href="pages/ico/152.png">
    <link rel="icon" type="image/x-icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta content="" name="description">
    <meta content="" name="author">
    <link href="/vendor/pace/pace-theme-flash.css" rel="stylesheet" type="text/css">
    <link href="/vendor/boostrapv3/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/vendor/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="/vendor/jquery-scrollbar/jquery.scrollbar.css" rel="stylesheet" type="text/css" media="screen">
    <link href="/vendor/bootstrap-select2/select2.css" rel="stylesheet" type="text/css" media="screen">
    <link href="/vendor/switchery/css/switchery.min.css" rel="stylesheet" type="text/css" media="screen">
    <link href="/vendor/bootstrap3-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css">
    <link href="/vendor/bootstrap-tag/bootstrap-tagsinput.css" rel="stylesheet" type="text/css">
    <link href="/vendor/dropzone/css/dropzone.css" rel="stylesheet" type="text/css">
    <link href="/vendor/bootstrap-datepicker/css/datepicker3.css" rel="stylesheet" type="text/css" media="screen">
    <link href="/vendor/summernote/css/summernote.css" rel="stylesheet" type="text/css" media="screen">
    <link href="/vendor/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" media="screen">
    <link href="/vendor/bootstrap-timepicker/bootstrap-timepicker.min.css" rel="stylesheet" type="text/css" media="screen">
    <link href="/templates/seller/pages/css/pages-icons.css" rel="stylesheet" type="text/css">
    <link class="main-stylesheet" href="/templates/seller/pages/css/pages.css" rel="stylesheet" type="text/css">
    <!--[if lte IE 9]>
    <link href="/vendor/codrops-dialogFx/dialog.ie.css" rel="stylesheet" type="text/css" media="screen" />
    <![endif]-->
    <style type="text/css">.cf-hidden { display: none; } .cf-invisible { visibility: hidden; }</style>
</head>
<body class="fixed-header windows desktop pace-done menu-pin menu-behind">
<div class="pace  pace-inactive">
    <div class="pace-progress" data-progress-text="100%" data-progress="99" style="transform: translate3d(100%, 0px, 0px);">
    <div class="pace-progress-inner"></div>
</div>
    <div class="pace-activity"></div>
</div>
{include file="sidebar" }
<div class="page-container ">
    {include file="header" }
    <div class="page-content-wrapper ">

        <div class="content ">

            <div class="jumbotron" data-pages="parallax">
                <div class="container-fluid container-fixed-lg sm-p-l-20 sm-p-r-20">
                    <div class="inner" style="transform: translateY(0px); opacity: 1;">
                        <ul class="breadcrumb">
                            <li>
                                <a href="/seller/index">工作台</a>
                            </li>
                            <li><a href="#" class="active">商品发布</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <form id="form-addgoods" method="post">
                <div class="container-fluid container-fixed-lg">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="panel-title">基本信息</div>
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>商品分类</label>
                                            <select class="full-width select2-offscreen" id="class_id" data-init-plugin="select2" tabindex="-1">
                                            <optgroup label="商品分类">
                                                {foreach $goods_class as $good_class}
                                                <option value="{$good_class.gc_id}">{$good_class.gc_name}</option>
                                                {/foreach}
                                            </optgroup>
                                        </select>
                                    </div>
                                    <div class="form-group required">
                                        <label>商品名称</label>
                                        <input type="text" id="goods_name" class="form-control" required>
                                    </div>
                                    <div class="form-group form-group-default input-group required">
                                        <label>商品价格</label>
                                        <input type="text" id="goods_price" class="form-control" required>
                                        <span class="input-group-addon">元</span>
                                    </div>
                                    <div class="form-group form-group-default input-group required">
                                        <label>市场价</label>
                                        <input type="text" id="goods_marketprice" class="form-control" required>
                                        <span class="input-group-addon">元</span>
                                    </div>
                                    <div class="form-group form-group-default input-group required">
                                        <label>成本价</label>
                                        <input type="text" id="goods_costprice" class="form-control" required>
                                        <span class="input-group-addon">元</span>
                                    </div>
                                    <div class="form-group required">
                                        <label>商品库存</label>
                                        <input type="text" id="goods_storage" class="autonumeric form-control" required>
                                    </div>
                                    <div class="form-group">
                                        <label>商家货号</label>
                                        <input type="text" id="goods_serial" class="autonumeric form-control">
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <label>商品封面</label>
                                    <div id="goods_image" class="dropzone"></div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="container-fluid container-fixed-lg">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="panel-title">商品详情描述</div>
                        </div>
                        <div class="panel-body no-scroll ">
                            <h5>商品描述</h5>
                            <div class="summernote-wrapper">
                                <div id="goods_body" ></div>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="container-fluid container-fixed-lg">
                    <button class="btn btn-success btn-lg btn-cons" id="btnSaveGoods">保存</button>
                </div>
            </form>
        </div>
        {include file="footer" }
    </div>

</div>

<script src="/vendor/pace/pace.min.js" type="text/javascript"></script>
<script src="/vendor/jquery/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="/vendor/modernizr.custom.js" type="text/javascript"></script>
<script src="/vendor/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="/vendor/boostrapv3/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/vendor/jquery/jquery-easy.js" type="text/javascript"></script>
<script src="/vendor/jquery-unveil/jquery.unveil.min.js" type="text/javascript"></script>
<script src="/vendor/jquery-bez/jquery.bez.min.js"></script>
<script src="/vendor/jquery-ios-list/jquery.ioslist.min.js" type="text/javascript"></script>
<script src="/vendor/jquery-actual/jquery.actual.min.js"></script>
<script src="/vendor/jquery-scrollbar/jquery.scrollbar.min.js"></script>
<script type="text/javascript" src="/vendor/bootstrap-select2/select2.min.js"></script>
<script type="text/javascript" src="/vendor/classie/classie.js"></script>
<script src="/vendor/switchery/js/switchery.min.js" type="text/javascript"></script>
<script src="/vendor/bootstrap3-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script type="text/javascript" src="/vendor/jquery-autonumeric/autoNumeric.js"></script>
<script type="text/javascript" src="/vendor/dropzone/dropzone.min.js"></script>
<script type="text/javascript" src="/vendor/bootstrap-tag/bootstrap-tagsinput.min.js"></script>
<script type="text/javascript" src="/vendor/jquery-inputmask/jquery.inputmask.min.js"></script>
<script src="/vendor/boostrap-form-wizard/js/jquery.bootstrap.wizard.min.js" type="text/javascript"></script>
<script src="/vendor/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script>
<script src="/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script>
<script src="/vendor/summernote/js/summernote.min.js" type="text/javascript"></script>
<script src="/vendor/moment/moment.min.js"></script>
<script src="/vendor/bootstrap-daterangepicker/daterangepicker.js"></script>
<script src="/vendor/bootstrap-timepicker/bootstrap-timepicker.min.js"></script>

<script src="/templates/seller/pages/js/pages.min.js"></script>

<!-- 配置文件 -->
<script type="text/javascript" src="/vendor/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/vendor/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('goods_body');
</script>

<script type="application/javascript">
    $(document).ready(function(){
        $('#form-addgoods').validate();
        $('#btnSaveGoods').click(function(){
            if($("#form-addgoods").valid()){
                var url = '/seller/goods/add';
                var data ={
                    gc_id:$('#class_id').val(),
                    goods_name:$('#goods_name').val(),
                    goods_price:$('#goods_price').val(),
                    goods_marketprice:$('#goods_marketprice').val(),
                    goods_costprice:$('#goods_costprice').val(),
                    goods_storage:$('#goods_storage').val(),
                    goods_serial:$('#goods_serial').val(),
                    goods_image:$('input[name=goods_image]').val(),
                    goods_body:$('#goods_body').val(),
                };
                $.post(url,data,function(result){
                    if(result.code == 1){
                        location.href= result.url;
                    }else{
                        alert(result.msg);
                    }
                },'json');
            }
        });

        //上传封面
        Dropzone.autoDiscover = false;
        var myDropzone = new Dropzone("#goods_image", {
            url: "/seller/upload",
            method: 'post',
            filesizeBase: 1024,
            sending: function(file, xhr, formData) {
                formData.append("filesize", file.size);
            },
            success: function (file, response, e) {
                var res = JSON.parse(response);
                if (res.error) {
                    $(file.previewTemplate).children('.dz-error-mark').css('opacity', '1');
                }else{
                    $(file.previewTemplate).children('.dz-success-mark').css('opacity', '1');
                    var path = "/uploads"+res.file.savepath+res.file.savename;
                    $goods_image = "<input type='hidden' name='goods_image' value='"+path+"'>";
                    $(file.previewTemplate).children('.dz-details').append($goods_image);
                }
            }
        });
    });
</script>

<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"><div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div></div><span role="status" aria-live="polite" class="select2-hidden-accessible"></span><span role="status" aria-live="polite" class="select2-hidden-accessible"></span><span role="status" aria-live="polite" class="select2-hidden-accessible"></span><div class="pg-colors"><div class="bg-success" data-color="success"></div><div class="bg-primary" data-color="primary"></div></div>


<script src="/templates/seller/js/form_elements.js" type="text/javascript"></script>
<script src="/templates/seller/js/scripts.js" type="text/javascript"></script>

<script src="/templates/seller/js/demo.js" type="text/javascript"></script>

<span role="status" aria-live="polite" class="select2-hidden-accessible"></span><div class="daterangepicker dropdown-menu show-calendar opensright" style="top: 2545px; left: 769.156px; right: auto;"><div class="calendar first right"><div class="calendar-date"><table class="table-condensed"><thead><tr><th></th><th colspan="5" class="month">Aug 2013</th><th class="next available"><i class="fa fa-chevron-right icon icon-arrow-right glyphicon glyphicon-arrow-right"></i></th></tr><tr><th>Su</th><th>Mo</th><th>Tu</th><th>We</th><th>Th</th><th>Fr</th><th>Sa</th></tr></thead><tbody><tr><td class="off disabled" data-title="r0c0">28</td><td class="off disabled" data-title="r0c1">29</td><td class="off disabled" data-title="r0c2">30</td><td class="off disabled" data-title="r0c3">31</td><td class="available active start-date end-date" data-title="r0c4">1</td><td class="available" data-title="r0c5">2</td><td class="available" data-title="r0c6">3</td></tr><tr><td class="available" data-title="r1c0">4</td><td class="available" data-title="r1c1">5</td><td class="available" data-title="r1c2">6</td><td class="available" data-title="r1c3">7</td><td class="available" data-title="r1c4">8</td><td class="available" data-title="r1c5">9</td><td class="available" data-title="r1c6">10</td></tr><tr><td class="available" data-title="r2c0">11</td><td class="available" data-title="r2c1">12</td><td class="available" data-title="r2c2">13</td><td class="available" data-title="r2c3">14</td><td class="available" data-title="r2c4">15</td><td class="available" data-title="r2c5">16</td><td class="available" data-title="r2c6">17</td></tr><tr><td class="available" data-title="r3c0">18</td><td class="available" data-title="r3c1">19</td><td class="available" data-title="r3c2">20</td><td class="available" data-title="r3c3">21</td><td class="available" data-title="r3c4">22</td><td class="available" data-title="r3c5">23</td><td class="available" data-title="r3c6">24</td></tr><tr><td class="available" data-title="r4c0">25</td><td class="available" data-title="r4c1">26</td><td class="available" data-title="r4c2">27</td><td class="available" data-title="r4c3">28</td><td class="available" data-title="r4c4">29</td><td class="available" data-title="r4c5">30</td><td class="available" data-title="r4c6">31</td></tr><tr><td class="available off" data-title="r5c0">1</td><td class="available off" data-title="r5c1">2</td><td class="available off" data-title="r5c2">3</td><td class="available off" data-title="r5c3">4</td><td class="available off" data-title="r5c4">5</td><td class="available off" data-title="r5c5">6</td><td class="available off" data-title="r5c6">7</td></tr></tbody></table></div><div class="calendar-time"><select class="hourselect"><option value="1" selected="selected">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select> : <select class="minuteselect"><option value="0">00</option><option value="30" selected="selected">30</option></select> <select class="ampmselect"><option value="AM">AM</option><option value="PM" selected="selected">PM</option></select></div></div><div class="calendar second left"><div class="calendar-date"><table class="table-condensed"><thead><tr><th class="prev available"><i class="fa fa-chevron-left icon icon-arrow-left glyphicon glyphicon-arrow-left"></i></th><th colspan="5" class="month">Aug 2013</th><th class="next available"><i class="fa fa-chevron-right icon icon-arrow-right glyphicon glyphicon-arrow-right"></i></th></tr><tr><th>Su</th><th>Mo</th><th>Tu</th><th>We</th><th>Th</th><th>Fr</th><th>Sa</th></tr></thead><tbody><tr><td class="available off" data-title="r0c0">28</td><td class="available off" data-title="r0c1">29</td><td class="available off" data-title="r0c2">30</td><td class="available off" data-title="r0c3">31</td><td class="available active start-date end-date" data-title="r0c4">1</td><td class="available" data-title="r0c5">2</td><td class="available" data-title="r0c6">3</td></tr><tr><td class="available" data-title="r1c0">4</td><td class="available" data-title="r1c1">5</td><td class="available" data-title="r1c2">6</td><td class="available" data-title="r1c3">7</td><td class="available" data-title="r1c4">8</td><td class="available" data-title="r1c5">9</td><td class="available" data-title="r1c6">10</td></tr><tr><td class="available" data-title="r2c0">11</td><td class="available" data-title="r2c1">12</td><td class="available" data-title="r2c2">13</td><td class="available" data-title="r2c3">14</td><td class="available" data-title="r2c4">15</td><td class="available" data-title="r2c5">16</td><td class="available" data-title="r2c6">17</td></tr><tr><td class="available" data-title="r3c0">18</td><td class="available" data-title="r3c1">19</td><td class="available" data-title="r3c2">20</td><td class="available" data-title="r3c3">21</td><td class="available" data-title="r3c4">22</td><td class="available" data-title="r3c5">23</td><td class="available" data-title="r3c6">24</td></tr><tr><td class="available" data-title="r4c0">25</td><td class="available" data-title="r4c1">26</td><td class="available" data-title="r4c2">27</td><td class="available" data-title="r4c3">28</td><td class="available" data-title="r4c4">29</td><td class="available" data-title="r4c5">30</td><td class="available" data-title="r4c6">31</td></tr><tr><td class="available off" data-title="r5c0">1</td><td class="available off" data-title="r5c1">2</td><td class="available off" data-title="r5c2">3</td><td class="available off" data-title="r5c3">4</td><td class="available off" data-title="r5c4">5</td><td class="available off" data-title="r5c5">6</td><td class="available off" data-title="r5c6">7</td></tr></tbody></table></div><div class="calendar-time"><select class="hourselect"><option value="1" selected="selected">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select> : <select class="minuteselect"><option value="0" selected="selected">00</option><option value="30">30</option></select> <select class="ampmselect"><option value="AM">AM</option><option value="PM" selected="selected">PM</option></select></div></div><div class="ranges"><div class="range_inputs"><div class="daterangepicker_start_input form-group form-group-default "><label for="daterangepicker_start">From</label><input class="form-control" type="text" name="daterangepicker_start" value=""></div><div class="daterangepicker_end_input form-group form-group-default "><label for="daterangepicker_end">To</label><input class="form-control" type="text" name="daterangepicker_end" value=""></div><button class="applyBtn btn btn-small btn-sm btn-success">Apply</button>&nbsp;<button class="cancelBtn btn btn-small btn-sm btn-default">Cancel</button></div></div></div><input type="file" multiple="multiple" style="visibility: hidden; position: absolute; top: 0px; left: 0px; height: 0px; width: 0px;"><iframe style="display: none;"></iframe><div id="pg-visible-sm" class="visible-sm"></div><div id="pg-visible-xs" class="visible-xs"></div>
</body>
</html>